<template>
  <div class="home">
    <div>过滤器测试{{ proxy.$filters.test(flag) }}</div>
    <div>
      <span>静态数据</span>
      <div v-for="(item, index) in PRODUCT_CATEGORY" :key="index">
        {{ item.product_name }}
      </div>
    </div>
    <div>
      <span>工具方法</span>
      <div>{{ time }}</div>
    </div>
    <div class="mixin-test">mixinnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn</div>
    <span class="iconfont icon-danta icon"></span>
    <span class="iconfont icon-buding icon"></span>
    <span class="iconfont icon-tiantianquan icon"></span>
    <span class="iconfont icon-quduoduo icon"></span>
    <span class="iconfont icon-makalong icon"></span>
    <span class="iconfont icon-fagun icon"></span>
    <span class="iconfont icon-aoliao icon"></span>
  </div>
  <div class="radius">element-ui Plus</div>
  <el-button type="primary" @click="btnClick">Primary</el-button>
</template>

<script>
import { getCurrentInstance, ref } from "vue";
import { PRODUCT_CATEGORY } from "../utils/staticData";
import { DateFormateDHMS } from "../utils/toolMethod";
import { login } from "../service/login";

export default {
  name: "Home",
  setup() {
    console.log(global.c.timeout);
    const { proxy } = getCurrentInstance();
    const flag = ref(0);

    let time = ref("");
    setInterval(() => {
      time.value = DateFormateDHMS(new Date());
    }, 1000);

    function btnClick() {
      login();
    }

    return {
      proxy,
      flag,
      PRODUCT_CATEGORY,
      time,
      btnClick,
    };
  },
};
</script>

<style lang="scss" scoped>
.mixin-test {
  width: 80px;
  color: $color-sub-theme;
  @include ellipsisBasic(1);
}
.icon {
  font-size: 80px;
  color: $color-theme;
}
.radius {
  height: 40px;
  width: 70%;
  border: 1px solid var(--el-border-color-base);
  border-radius: 0;
  margin-top: 20px;
}
</style>
